from django.db import models
from mongoengine import *
# Create your models here.


class Point(EmbeddedDocument):
    """
    社区实体嵌入的配送点
    """
    point_name = StringField(max_length=120)
    point_address = StringField(max_length=120)
    status = StringField(max_length=30)


class Community(Document):
    """
    社区实体
    """
    name = StringField(max_length=120)
    points = ListField(EmbeddedDocumentField(Point))


class Account(Document):
    """
    账户实体
    """
    user_name = StringField(max_length=255)
    password = StringField(max_length=50)
    community_id = ReferenceField(Community) # 社区名称
